﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace Three_Red_Dragon_Mvc.Controllers
{
    /// <summary>
    /// 工序管理
    /// </summary>
    public class ProcessController : Controller
    {
        private readonly IpAddressesConfig _ipAddressesConfig;

        public ProcessController(IOptions<IpAddressesConfig> ipAddressesConfig)
        {
            _ipAddressesConfig = ipAddressesConfig.Value;
        }

        public IActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 工序列表
        /// </summary>
        /// <returns></returns>
        public IActionResult ProcessList()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 工序新增
        /// </summary>
        /// <returns></returns>
        public IActionResult ProcessAdd()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 弹出层页面
        /// </summary>
        /// <returns></returns>
        public IActionResult ResouresAdd()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 工序路线列表
        /// </summary>
        /// <returns></returns>
        public IActionResult ProcessRouteInfo()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 添加工艺路线
        /// </summary>
        /// <returns></returns>
        public IActionResult CreateProcessRoute()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }


        /// <summary>
        /// 工艺路线工序添加
        /// </summary>
        /// <returns></returns>
        public IActionResult CreateProcessLineOperation()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 工艺路线工序详情页
        /// </summary>
        /// <returns></returns>
        public IActionResult ProcessLineOperationDetails()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
    }
}
